IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_tmptreatment_treatmenttype]') AND parent_object_id = OBJECT_ID(N'[dbo].[tmptreatment]'))
ALTER TABLE [dbo].[tmptreatment] DROP CONSTRAINT [FK_tmptreatment_treatmenttype]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_textinfo_textinfotype]') AND parent_object_id = OBJECT_ID(N'[dbo].[textinfo]'))
ALTER TABLE [dbo].[textinfo] DROP CONSTRAINT [FK_textinfo_textinfotype]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_tmpdisease_diseasetype]') AND parent_object_id = OBJECT_ID(N'[dbo].[tmpdisease]'))
ALTER TABLE [dbo].[tmpdisease] DROP CONSTRAINT [FK_tmpdisease_diseasetype]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_tmpdisease_userinfo]') AND parent_object_id = OBJECT_ID(N'[dbo].[tmpdisease]'))
ALTER TABLE [dbo].[tmpdisease] DROP CONSTRAINT [FK_tmpdisease_userinfo]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_tmpsymptom_symptomtype]') AND parent_object_id = OBJECT_ID(N'[dbo].[tmpsymptom]'))
ALTER TABLE [dbo].[tmpsymptom] DROP CONSTRAINT [FK_tmpsymptom_symptomtype]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_treatmentevaluation_patientrecord]') AND parent_object_id = OBJECT_ID(N'[dbo].[treatmentevaluation]'))
ALTER TABLE [dbo].[treatmentevaluation] DROP CONSTRAINT [FK_treatmentevaluation_patientrecord]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_treatmentevaluation_treatment]') AND parent_object_id = OBJECT_ID(N'[dbo].[treatmentevaluation]'))
ALTER TABLE [dbo].[treatmentevaluation] DROP CONSTRAINT [FK_treatmentevaluation_treatment]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_disease_diseasetype]') AND parent_object_id = OBJECT_ID(N'[dbo].[disease]'))
ALTER TABLE [dbo].[disease] DROP CONSTRAINT [FK_disease_diseasetype]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_patientrecord_disease]') AND parent_object_id = OBJECT_ID(N'[dbo].[patientrecord]'))
ALTER TABLE [dbo].[patientrecord] DROP CONSTRAINT [FK_patientrecord_disease]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_patientrecord_userinfo]') AND parent_object_id = OBJECT_ID(N'[dbo].[patientrecord]'))
ALTER TABLE [dbo].[patientrecord] DROP CONSTRAINT [FK_patientrecord_userinfo]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_symptom_symptomtype]') AND parent_object_id = OBJECT_ID(N'[dbo].[symptom]'))
ALTER TABLE [dbo].[symptom] DROP CONSTRAINT [FK_symptom_symptomtype]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_treatment_treatmenttype]') AND parent_object_id = OBJECT_ID(N'[dbo].[treatment]'))
ALTER TABLE [dbo].[treatment] DROP CONSTRAINT [FK_treatment_treatmenttype]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_diseasesymptom_disease]') AND parent_object_id = OBJECT_ID(N'[dbo].[diseasesymptom]'))
ALTER TABLE [dbo].[diseasesymptom] DROP CONSTRAINT [FK_diseasesymptom_disease]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_diseasesymptom_symptom]') AND parent_object_id = OBJECT_ID(N'[dbo].[diseasesymptom]'))
ALTER TABLE [dbo].[diseasesymptom] DROP CONSTRAINT [FK_diseasesymptom_symptom]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_diseasetreatment_disease]') AND parent_object_id = OBJECT_ID(N'[dbo].[diseasetreatment]'))
ALTER TABLE [dbo].[diseasetreatment] DROP CONSTRAINT [FK_diseasetreatment_disease]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_diseasetreatment_treatment]') AND parent_object_id = OBJECT_ID(N'[dbo].[diseasetreatment]'))
ALTER TABLE [dbo].[diseasetreatment] DROP CONSTRAINT [FK_diseasetreatment_treatment]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_diseaselabcheck_disease]') AND parent_object_id = OBJECT_ID(N'[dbo].[diseaselabcheck]'))
ALTER TABLE [dbo].[diseaselabcheck] DROP CONSTRAINT [FK_diseaselabcheck_disease]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_diseaselabcheck_labcheck]') AND parent_object_id = OBJECT_ID(N'[dbo].[diseaselabcheck]'))
ALTER TABLE [dbo].[diseaselabcheck] DROP CONSTRAINT [FK_diseaselabcheck_labcheck]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_patientsymptom_patientrecord]') AND parent_object_id = OBJECT_ID(N'[dbo].[patientsymptom]'))
ALTER TABLE [dbo].[patientsymptom] DROP CONSTRAINT [FK_patientsymptom_patientrecord]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_patienttreatment_patientrecord]') AND parent_object_id = OBJECT_ID(N'[dbo].[patienttreatment]'))
ALTER TABLE [dbo].[patienttreatment] DROP CONSTRAINT [FK_patienttreatment_patientrecord]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_patienttreatment_treatment]') AND parent_object_id = OBJECT_ID(N'[dbo].[patienttreatment]'))
ALTER TABLE [dbo].[patienttreatment] DROP CONSTRAINT [FK_patienttreatment_treatment]
GO
IF  EXISTS (SELECT * FROM sys.foreign_keys WHERE object_id = OBJECT_ID(N'[dbo].[FK_patientCheck_patientrecord]') AND parent_object_id = OBJECT_ID(N'[dbo].[patientcheck]'))
ALTER TABLE [dbo].[patientcheck] DROP CONSTRAINT [FK_patientCheck_patientrecord]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Friend]') AND type in (N'U'))
DROP TABLE [dbo].[Friend]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Comment]') AND type in (N'U'))
DROP TABLE [dbo].[Comment]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[patientrelation]') AND type in (N'U'))
DROP TABLE [dbo].[patientrelation]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[loginfo]') AND type in (N'U'))
DROP TABLE [dbo].[loginfo]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[image]') AND type in (N'U'))
DROP TABLE [dbo].[image]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Action]') AND type in (N'U'))
DROP TABLE [dbo].[Action]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tmptreatment]') AND type in (N'U'))
DROP TABLE [dbo].[tmptreatment]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LogReply]') AND type in (N'U'))
DROP TABLE [dbo].[LogReply]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[textinfo]') AND type in (N'U'))
DROP TABLE [dbo].[textinfo]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tmpdisease]') AND type in (N'U'))
DROP TABLE [dbo].[tmpdisease]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tmpsymptom]') AND type in (N'U'))
DROP TABLE [dbo].[tmpsymptom]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[treatmentevaluation]') AND type in (N'U'))
DROP TABLE [dbo].[treatmentevaluation]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[textinfotype]') AND type in (N'U'))
DROP TABLE [dbo].[textinfotype]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[UserActivity]') AND type in (N'U'))
DROP TABLE [dbo].[UserActivity]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientSymptomHistory]') AND type in (N'U'))
DROP TABLE [dbo].[PatientSymptomHistory]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[ActivityNews]') AND type in (N'U'))
DROP TABLE [dbo].[ActivityNews]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[userinfo]') AND type in (N'U'))
DROP TABLE [dbo].[userinfo]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[district]') AND type in (N'U'))
DROP TABLE [dbo].[district]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[disease]') AND type in (N'U'))
DROP TABLE [dbo].[disease]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[patientrecord]') AND type in (N'U'))
DROP TABLE [dbo].[patientrecord]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[symptom]') AND type in (N'U'))
DROP TABLE [dbo].[symptom]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[message]') AND type in (N'U'))
DROP TABLE [dbo].[message]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientCurrentSymptom]') AND type in (N'U'))
DROP TABLE [dbo].[PatientCurrentSymptom]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Group]') AND type in (N'U'))
DROP TABLE [dbo].[Group]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[treatment]') AND type in (N'U'))
DROP TABLE [dbo].[treatment]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientCurrentTreatment]') AND type in (N'U'))
DROP TABLE [dbo].[PatientCurrentTreatment]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientTreatmentHistory]') AND type in (N'U'))
DROP TABLE [dbo].[PatientTreatmentHistory]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientSurvey]') AND type in (N'U'))
DROP TABLE [dbo].[PatientSurvey]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GroupUser]') AND type in (N'U'))
DROP TABLE [dbo].[GroupUser]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientCurrentIndicator]') AND type in (N'U'))
DROP TABLE [dbo].[PatientCurrentIndicator]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[treatmenttype]') AND type in (N'U'))
DROP TABLE [dbo].[treatmenttype]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Reply]') AND type in (N'U'))
DROP TABLE [dbo].[Reply]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientIndicatorHistory]') AND type in (N'U'))
DROP TABLE [dbo].[PatientIndicatorHistory]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientCurrentWeight]') AND type in (N'U'))
DROP TABLE [dbo].[PatientCurrentWeight]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[symptomtype]') AND type in (N'U'))
DROP TABLE [dbo].[symptomtype]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GroupType]') AND type in (N'U'))
DROP TABLE [dbo].[GroupType]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[PatientWeightHistory]') AND type in (N'U'))
DROP TABLE [dbo].[PatientWeightHistory]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[diseasetype]') AND type in (N'U'))
DROP TABLE [dbo].[diseasetype]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[GroupNews]') AND type in (N'U'))
DROP TABLE [dbo].[GroupNews]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[diseasesymptom]') AND type in (N'U'))
DROP TABLE [dbo].[diseasesymptom]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[diseasetreatment]') AND type in (N'U'))
DROP TABLE [dbo].[diseasetreatment]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[diseaselabcheck]') AND type in (N'U'))
DROP TABLE [dbo].[diseaselabcheck]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[labcheck]') AND type in (N'U'))
DROP TABLE [dbo].[labcheck]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Topic]') AND type in (N'U'))
DROP TABLE [dbo].[Topic]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[DiseaseGraphSetting]') AND type in (N'U'))
DROP TABLE [dbo].[DiseaseGraphSetting]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[LogTopic]') AND type in (N'U'))
DROP TABLE [dbo].[LogTopic]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[patientsymptom]') AND type in (N'U'))
DROP TABLE [dbo].[patientsymptom]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[patienttreatment]') AND type in (N'U'))
DROP TABLE [dbo].[patienttreatment]
GO
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[patientcheck]') AND type in (N'U'))
DROP TABLE [dbo].[patientcheck]
